package com.hxt.app;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.orm.jpa.EntityScan;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * spring boot 结合hibernate和spring mvc
 * Created by Huangxiutao on 2017/3/31.
 */
@SpringBootApplication
@EnableJpaRepositories(basePackages="com.hxt.repository")
@EntityScan(basePackages = "com.hxt")
@ComponentScan(value = {"com.hxt.controller"})
//记得加ComponentScan 这样才会加载相应的controller
public class AppWithHibernate {
    public static void main(String[] args){
        SpringApplication.run(AppWithHibernate.class,args);
    }
}
